<%@ page language="java" %>
<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.operations.process.VendorLocation,
                 com.scalar.chiptrack.operations.vendor.dao.VendorDAO,
                 com.scalar.chiptrack.utils.ConfigManager"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %> 
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/test.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<html:html locale="true">
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/test_process.js"></script>
<script language='javascript'>
    function back(){
       window.location = '<%=chipTracContext%>/processView.do?action=true&productID='+document.testForm.baseProductId.value;
    }
</script>

<META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onLoad="javascript:whileLoad()";>
<%
 
  java.util.ArrayList list = new java.util.ArrayList();
  list.add(new org.apache.struts.util.LabelValueBean("As Needed", "asneeded"));
  list.add(new org.apache.struts.util.LabelValueBean("Weekly", "weekly"));
  list.add(new org.apache.struts.util.LabelValueBean("Monthly", "monthly"));
  list.add(new org.apache.struts.util.LabelValueBean("Quarterly", "quarterly"));
  pageContext.setAttribute("poFrequencies", list);
%>

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->
<%@ include file="/jsp/operations/operations_menu.jsp" %>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp   /includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<p align="center">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->

<span class="NArialW"><bean:write name="testForm" property="stepName"/></span>
<p align="left"><chiptrack:errors styleClass="NArialL"/></p>
<p align="left">
<strong><font class="NArialL"><font color="FF0000"><font id="message"></font></font></font></strong>
</p>
<p align="right"></p>

<table border="0" width="90%" align=right>
<tr><td>

<html:form name="testForm" type="com.scalar.chiptrack.operations.test.forms.testForm" action="/test.do?action=save" enctype="multipart/form-data">
<html:hidden name="testForm" property="baseProductId"/>
<html:hidden name="testForm" property="stepName"/>
<html:hidden name="testForm" property="previousStepId"/>
<html:hidden name="testForm" property="trackId"/>
<html:hidden name="testForm" property="binSetupEnabled"/>
<html:hidden name="testForm" property="processStepId"/>

<table border="0" width="100%" align=right>

  <tr>
    <td width="21%"><font class="NArialL">Test Product Name:</font></td>
    <td width="28%" align="left">
          <font class="NArialL">
		  <html:text name="testForm" property="testProductName" size="17" maxlength="30" styleClass="txfield"/></font><a href="javascript:addDupPartNumber('dupProductName','Test Product Name');" title='Click here to add duplicate Product Name'><img border=0 src='<%=chipTracContext%>/jsp/includes/images/add.jpg' height='15' width='20' align=center></a>
    </td>
    <td width="5%">&nbsp;</td>
   <td width="18%"><font class="NArialL">Target Yield:</font></td>
    <td width="37%" align="left">
          <html:text name="testForm" property="targetYield" size="17" maxlength="8" styleClass="txfield"/>
  </tr>
  <logic:iterate name="testForm" property="dupProductName" id="xxxx">
  <tr>
	<td width="21%"><font class="NArialL"><font color=green>Test Product Name:</font></font></td>
    <td width="28%" align="left">
		<input type="text" name="dupProductName" value="<%=xxxx%>" class=txfield size="17" maxlength="50" />
	</td>
  </tr>
  </logic:iterate>
  <tr>
	<td colspan='5'><font id="font1"></font></td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Lot Hold Yield Limit:</font></td>
    <td width="28%" align="left">
        <html:text name="testForm" property="lotHoldYieldLimit" size="17" maxlength="8" styleClass="txfield"/>
    </td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Lot Scrap Yield Limit:</font></td>
    <td width="37%" align="left"><html:text name="testForm" property="lotScrapYieldLimit" size="17" maxlength="8" styleClass="txfield"/></td>
  </tr>
  <tr>
    <td width="21%"><font class="NArialL">Standard Unit Cost:</font></td>
    <td width="28%" align="left"><html:text name="testForm" property="standardUnitCost" size="17" maxlength="8" styleClass="txfield"/></td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">PO Frequency:</font></td>
    <td width="37%" align="left">
    
        <html:select name="testForm" property="poFrequency" styleClass="txfield">
			<html:option value="0">Select</html:option>
            <html:options collection="poFrequencies" property="value" labelProperty="label"/>
    	</html:select>

    </td>

  </tr>

    <tr>
    <td width="21%"><font class="NArialL">Procedure Doc. No:</font></td>
    <td width="28%" align="left"><font class="NArialL">
    	<html:text name="testForm" property="procedureDocNumber" size="17" maxlength="20" styleClass="txfield"/></font></td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Program Doc. No:</font></td>
    <td width="37%" align="left"><font class="NArialL">
    	<html:text name="testForm" property="programDocNumber" size="17" maxlength="20" styleClass="txfield"/></font></td>
  </tr>


  <tr>
    <td width="21%"><font class="NArialL">Procedure Doc File:</font></td>
    <td width="28%" align="left"><font class="NArialL">
    	<input type=file name="procedureDocFile" size="9" class="txfield"></font></td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">Program Doc File:</font></td>
    <td width="37%" align="left"><font class="NArialL">
    	<input type="file" name="programDocFile" size="9" class="txfield"></font></td>
  </tr>

  <tr>
    <td width="21%"><font class="NArialL">Test Jig:</font></td>
    <td width="28%" align="left"><font class="NArialL">
    	<html:text name="testForm" property="testJig" size="17" maxlength="50" styleClass="txfield"/></font></td>
    <td width="5%">&nbsp;</td>
    <td width="18%"><font class="NArialL">System:</font></td>
    <td width="37%" align="left"><font class="NArialL"><html:text name="testForm" property="system" size="17" maxlength="50" styleClass="txfield"/></font></td>
  </tr>
  <tr>
    <td width="21%"></td>
    <td width="28%" align="left"></td>
    <td width="5%"></td>
    <td width="18%"></td>
    <td width="37%" align="left"></td>
  </tr>
  <tr><td colspan=5>&nbsp</td></tr>
  <tr><td colspan=5 class="NArialL">Comments:</td></tr>
  <tr><td colspan=5 class="NArialL"><html:textarea rows="4" name="testForm" property="comments" cols="94" styleClass="txfield"/></td></tr>
</table>
</td></tr>
<tr><td>
<table border="0" width="98%" bordercolor="#FFFFFF">
    <tr>
      <td colspan=7 class="NArialL">Vendor Location Information:</td></tr>
    <tr>
	  <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Select to Edit</font></td>
	  <td width="10%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Priority</font></td>
      <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Location</font></td>
      <td width="5%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">% Split</font></td>
      <td width="10%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Capacity/Week</font></td>
      <td width="10%" align="center" bgcolor="#993333" colspan="2">

       <p align="center"><font color="#FFFFFF" class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;
        <font class="NArialL"><font color="#FFFFFF">Cost/Unit&nbsp;&nbsp;</font>&nbsp;<font class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;
        <font color="#FFFFFF">Normal&nbsp; Express</font>
        </p>

        </font>
        </font></font></td>
	  <td width="10%" align="center" bgcolor="#993333" colspan="2">
	 <p align="center"><font color="#FFFFFF" class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;
        <font class="NArialL"><font color="#FFFFFF">Cycle Time&nbsp;&nbsp;</font>&nbsp;<font class="NArialL">&nbsp;&nbsp;&nbsp;&nbsp;
        <font color="#FFFFFF">Normal&nbsp; Express</font>
        </p>
        </font>
        </font></font>
        	  </td>

    </tr>

    <%
        ArrayList vendorLocations = (ArrayList) request.getAttribute("vendorLocations");
        if (vendorLocations == null) vendorLocations = new ArrayList();
        int size = vendorLocations.size();
        VendorLocation location = null;
        for (int i=0; i<size; i++) {
            location = (VendorLocation) vendorLocations.get(i);
    %>
    <tr>
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type="checkbox" name="<%="select_"+i%>" onclick="checkLocation(<%=i%>,'select_')"  <%if((location.getSelect() != null) && (location.getSelect().trim().length() != 0)) out.print ("checked");%> class="txfield" value="off"/></font></td>        
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="priority" size="6" disabled="true" value='<%if (location.getPriority() != null) out.print (location.getPriority());%>' class="txfield" /></font></td>
        <td width="20%" align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  
        <input text="text" name="locationName"  disabled="true" value='<%=location.getLocationName()%>' size="18" class="txfield">
        <input type="hidden" name="locationID"  value='<%=location.getLocationIDAsInt()%>' size="18" class="txfield" /></font></td>
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="split" size="7" disabled="true" value='<%if (location.getSplit() != null) out.print (location.getSplit());%>' class="txfield" /></font></td>
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="capacityWeek" disabled="true" size="14" value='<%if (location.getCapacityWeek() != null) out.print (location.getCapacityWeek());%>' class="txfield" /></font></td>                                            
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="normalCost" size="6" disabled="true" value='<%=location.getNormalCost()%>' class="txfield" /></font></td>
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="expressCost" size="6" disabled="true" value='<%=location.getExpressCost()%>' class="txfield" /></font></td>
        <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="normalCycleTime" size="6" disabled="true" value='<%if (location.getNormalCycleTime() != null) out.print (location.getNormalCycleTime());%>' class="txfield" /></font></td>
                                                    <td width="5%"  align="center"  bgcolor="#DEE1E2">  <font class="NArialL">  <input type=text name="expressCycleTime" disabled="true" size="6" value='<%if (location.getExpressCycleTime() != null) out.print (location.getExpressCycleTime());%>' class="txfield" /></font></td>
    </tr>
    <%
        }
    %>

    <tr><td colspan=4 height="27">&nbsp;</td></tr>
    <tr align="center">
    <td align=center colspan=9 height="27">
        <!--a href="javascript:saveTestData()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17"></a-->
        <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:back();' onmouseover="window.status='Click here to go back to Process View';return true" onmouseout="window.status='';return true">
        <img border='0' src='<%=chipTracContext%>/jsp/includes/images/back.gif'></chiptrack:restrictedLink></a>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <!--a href="#"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a-->
        <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:saveTestData();' onmouseover="window.status='Click here to save this Test Process';return true" onmouseout="window.status='';return true">
        <img border='0' src='<%=chipTracContext%>/jsp/includes/images/next.gif'></chiptrack:restrictedLink>
    </td></tr>

  </table>
  <input type="hidden" name="count" value="<%=size%>" >
</td></tr>

</table>


<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>

</TR>
</TABLE>

</html:form>

<BR><BR>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</body>

</html:html>